home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4593 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.8 KB

  1. Path: nut.trin.cam.ac.uk!jad1002
  2. From: jad1002@cam.ac.uk (James Dennett)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2
  4. Subject: Re: Hungarian notation
  5. Date: Wed, 31 Jan 1996 02:01:16
  6. Organization: University of Cambridge, England
  7. Message-ID: <jad1002.29.00020579@cam.ac.uk>
  8. References: <30C40F77.53B5@swsbbs.com> <4bd <4cc2b2$11jq@navajo.gate.net> <4cud8f$gup@news.netvision.net.il> <4dttefINNo29@keats.ugrad.cs.ubc.ca> <Pine.HPP.3.91.960122145028.27524A-100000@clear.cs.byu.edu> <dewar.822407363@schonberg> <Pine.HPP.3.91.960124References: <30C40F77.53B5@swsbbs.com> <4bd <4cc2b2$11jq@navajo.gate.net> <4cud8f$gup@news.netvision.net.il> <4dttefINNo29@keats.ugrad.cs.ubc.ca> <Pine.HPP.3.91.960122145028.27524A-100000@clear.cs.byu.edu> <dewar.822407363@schonberg> <Pine.HPP.3.91.960124Organization: Trinity College, Cambridge
  9. NNTP-Posting-Host: nut.trin.cam.ac.uk
  10. X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
  11.  
  12. In article <Pine.HPP.3.91.960129133429.8419C-100000@foggy.cs.byu.edu> Douglas Evan Cook <cookd@cs.byu.edu> writes:
  13. >From: Douglas Evan Cook <cookd@cs.byu.edu>
  14. >Subject: Re: Hungarian notation
  15. >Date: Mon, 29 Jan 1996 13:42:18 -0700
  16.  
  17. >On 25 Jan 1996, Richard A. O'Keefe wrote:
  18.  
  19. >> Suppose there is some package that defines a type Pack.T
  20. >> where I don't have access to the representation, only the operations.
  21. >> As long as there is a Pack.T'Write and a Pack.T'Read (forgive me if
  22. >> I've got the syntax a bit wrong, I'm still learning about Ada 95
  23. >> streams) *I* don't have to know what the size of an instance of the
  24. >> type is in the file.  The size appears explicitly nowhere in my code.
  25.  
  26. >No, but somebody must have written those methods, no?  And that somebody 
  27. >needed to know how many bits each data type is, no?  When we changed from 
  28. >16 bit compiler to 32 bit compiler, the data files remained the same.  
  29.  
  30. Herein lies your problem - you broke the ADT. If the ADT didn't specify the
  31. size of the components then your code can't rely on them...
  32. so the data files would not necessarily remain the same if
  33. the implementation of the ADT changed.
  34.  
  35. A clean way to deal with this would be to convert the data files. Done
  36. properly, this wouldn't inconvenience users.
  37.  
  38. Now, if you wanted to keep the same data files then your type specification 
  39. should have mentioned the implementation details is a little more detail. 
  40. Slightly ugly from an abstract point of view, but RL is like that.
  41.  
  42. Flame if you will.
  43.  
  44. James Dennett
  45.  
  46. >Any code that directly accesses the data structures (which is rare 
  47. >outside of library design) needs to know the data structure.  Also, when 
  48. >you are making system calls (in assembler, or when you are interfacing 
  49. >with Windows and need to do an API call) you also need to do bit level 
  50. >interaction with the data structures.
  51.  
  52.  
  53.